//## begin module%3B8CD3400348.cm preserve=no
//	  %X% %Q% %Z% %W%
//## end module%3B8CD3400348.cm

//## begin module%3B8CD3400348.cp preserve=no
//	+----------------------------------------------+
//	| SVMBR - A program for training SVMs          |
//	+----------------------------------------------+
//	| * Creator, modeling, coding:                 |
//	|    Marcelo Barros de Almeida                 |
//	|    barros@smar.com.br                        |
//	|    http://litc.cpdee.ufmg.br/~barros/        |
//	| * Coding, improvements, bug fixes:           |
//	|    Bernardo Penna                            |
//	|    bprc@brfree.com.br                        |
//	+----------------------------------------------+
//
//	 Copyright(c) 2002 by Marcelo Barros de Almeida
//	                            All rights reserved
//
//	-[CVS]------------------------------------------
//	$Author$
//	$Date$
//	$Source$
//	$Name$
//	$Revision$
//	------------------------------------------------
//## end module%3B8CD3400348.cp

//## Module: cronometer%3B8CD3400348; Package body
//## Subsystem: <Top Level>
//## Source file: D:\textotese\svmbr\src\cronometer.cpp

//## begin module%3B8CD3400348.additionalIncludes preserve=no
//## end module%3B8CD3400348.additionalIncludes

//## begin module%3B8CD3400348.includes preserve=yes
//## end module%3B8CD3400348.includes

// cronometer
#include "cronometer.h"
//## begin module%3B8CD3400348.declarations preserve=no
//## end module%3B8CD3400348.declarations

//## begin module%3B8CD3400348.additionalDeclarations preserve=yes
//## end module%3B8CD3400348.additionalDeclarations


// Class Cronometer 



Cronometer::Cronometer()
  //## begin Cronometer::Cronometer%.hasinit preserve=no
  //## end Cronometer::Cronometer%.hasinit
  //## begin Cronometer::Cronometer%.initialization preserve=yes
  //## end Cronometer::Cronometer%.initialization
{
  //## begin Cronometer::Cronometer%.body preserve=yes
	totalTime = 0;
  //## end Cronometer::Cronometer%.body
}


Cronometer::~Cronometer()
{
  //## begin Cronometer::~Cronometer%.body preserve=yes
  //## end Cronometer::~Cronometer%.body
}



//## Other Operations (implementation)
VOID Cronometer::startCronometer ()
{
  //## begin Cronometer::startCronometer%999084989.body preserve=yes
	startTime = getTime();
  //## end Cronometer::startCronometer%999084989.body
}

VOID Cronometer::finishCronometer ()
{
  //## begin Cronometer::finishCronometer%999084990.body preserve=yes
	finishTime = getTime();
	stopCronometer (); // REMOVER ESTA FUNCAO (FINISH) DA CLASSE !!!!!!!!

  //## end Cronometer::finishCronometer%999084990.body
}

REAL Cronometer::getElapsedTime ()
{
  //## begin Cronometer::getElapsedTime%999084991.body preserve=yes
  return totalTime;
  //## end Cronometer::getElapsedTime%999084991.body
}

UINT Cronometer::getTime ()
{
  //## begin Cronometer::getTime%999084992.body preserve=yes
#ifndef _MSC_VER
  struct tms time;
  times(&time);
  return((UINT)(time.tms_utime + time.tms_stime));
#else
	return clock();
#endif
  //## end Cronometer::getTime%999084992.body
}

VOID Cronometer::stopCronometer ()
{
  //## begin Cronometer::stopCronometer%1013528665.body preserve=yes
	finishTime = getTime();
	totalTime += (REAL)(finishTime - startTime)/((REAL)CLK_TCK);
  //## end Cronometer::stopCronometer%1013528665.body
}

// Additional Declarations
  //## begin Cronometer%3B8CD231004F.declarations preserve=yes
  //## end Cronometer%3B8CD231004F.declarations

//## begin module%3B8CD3400348.epilog preserve=yes
//## end module%3B8CD3400348.epilog
